module MassiveClassRoom
  # By default, the +Character+ class creates a +Character+ object
  # without a name and an empty +Hash+ for abilities, while providing
  # the expected defaults for level and experience (1 and 0, respective).
  #
  # The Character class can be initialized in the normal way, or with a block. 
  # 
  # This is the base class, from which the three default character classes
  # derive. As such, there should be no need to instantiate the Character class
  # on its own.
  #
  class Character

    # By default, the +Character+ class creates a +Character+ object
    # without a name and an empty +Hash+ for abilities, while providing
    # the expected defaults for level and experience (1 and 0, respective).
    # 
    # The Character class can be initialized in the normal way, or with a block.
    #
    # By default, only the name is passed to +new+. The class provides
    # sensible defaults for all other attributes.
    #
    def initialize(name = '', level = 1, xp = 0, abilities = {})
      @name = name
      @level = level
      @xp = xp
      @abilities = abilities 
      yield( self ) if block_given?
    end

    attr_reader :name, :level, :xp, :abilities
    attr_accessor :name
  end
end
